<script setup>
import { ref, onMounted, onUnmounted, computed } from 'vue'
import { ElButton } from 'element-plus'
import { Menu } from 'lucide-vue-next'
import MenuDrawer from '@/views/Front/components/MenuDrawer.vue'

const showMenu = ref(true)
const menu = ref(false)

const handleScroll = () => {
  const landingSection = document.querySelector('.landing-section')
  if (landingSection) {
    const rect = landingSection.getBoundingClientRect()
    showMenu.value = rect.bottom > 0
  }
}

onMounted(() => {
  window.addEventListener('scroll', handleScroll)
})

onUnmounted(() => {
  window.removeEventListener('scroll', handleScroll)
})
</script>

<template>
  <div class="landing-section">
    <MenuDrawer v-model="menu" />
    <div class="landing-content">
      <h1 class="title">尊尼获加</h1>
      <p class="subtitle">我锤石你德玛</p>
    </div>
    
    <div class="scroll-indicator">
      <div class="chevron"></div>
    </div>
  </div>
</template>

<style scoped>
.landing-section {
  height: 100vh;
  background-image: url('../../../assets/images/landing.png');
  background-size: cover;
  background-position: center 30%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.landing-content {
  text-align: center;
  color: white;
  position: relative;
  z-index: 1;
}

.title {
  font-size: 5rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
  font-size: 2rem;
  opacity: 0.9;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.chevron {
  width: 30px;
  height: 30px;
  border-right: 4px solid white;
  border-bottom: 4px solid white;
  transform: rotate(45deg);
  animation: bounce 2s infinite;
}

@keyframes bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0) rotate(45deg);
  }

  40% {
    transform: translateY(-15px) rotate(45deg);
  }

  60% {
    transform: translateY(-7px) rotate(45deg);
  }
}
</style>

